package com.accp.crm.service;

import java.util.List;

import org.hibernate.SessionFactory;

import com.accp.crm.dao.CommonDAO;
import com.accp.crm.entity.SysRole;

public class RoleService implements IRoleService {
    private CommonDAO<SysRole> roleDAO;
    public void setSessionFactory(SessionFactory sessionFactory){
    	roleDAO=new CommonDAO<SysRole>(sessionFactory, SysRole.class);
    }
    
    public List findAll(){
    	return this.roleDAO.findAll();
    }
    public SysRole findById(Long id){
    	return this.roleDAO.findById(id);
    }

	@Override
	public void add(SysRole role) {
		this.roleDAO.save(role);
		
	}
}
